/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn;

import java.util.Scanner;

/**
 * <p>Project: jse2204 - ColorDemo
 * <p>Powered by webrx On 2022-10-11 09:34:56
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class ColorDemo {
    public static void main(String[] args) {
        //Color c = Color.BLUE;
        //Color c2 = Color.RED;


        BankActionEnum action = BankActionEnum.SAVE;

        System.out.println(action);//名称 SAVE
        System.out.println(action.name());//名称 SAVE
        System.out.println(action.ordinal());//索引号 1
        System.out.println(action.read()); //代号是 2
        System.out.println(BankActionEnum.from(3)); //根据3获取枚举

        Scanner sc = new Scanner(System.in);
        System.out.print("请输入数字：");
        int i = sc.nextInt();
        action = BankActionEnum.from(i);


        switch (action) {
            case LOAD:
                System.out.println("加载数据");
                break;
            case SAVE:
                System.out.println("数据保存");
                break;
            case READ:
                System.out.println("读取数据");
                break;
        }
    }
}
